cmake_minimum_required(VERSION 3.0.0)
project(intelligence-language-learning VERSION 0.1.0 LANGUAGES C)

add_executable(intelligent-language-learning main.c)

add_executable(control control.c)
target_link_libraries(control asound)

#add_executable(record record.c)
#target_link_libraries(record asound)

#add_executable(play play.c)
#target_link_libraries(play asound)

add_executable(key key.c record.c)
target_link_libraries(key gpiod asound)

# add_executable(key2 key2.c token.c http.c config.c record.c)
# target_compile_definitions(key2 PRIVATE _GNU_SOURCE)
# target_link_libraries(key2 curl cjson gpiod asound)

add_subdirectory(snowboy)
add_executable(wake wake.c record.c stt.c token.c http.c config.c)
target_link_libraries(wake snowboy-wrapper snowboy-detect cblas m stdc++ asound curl cjson)
target_compile_definitions(wake PRIVATE _GNU_SOURCE)

add_executable(jrsc jrsc.c)
target_link_libraries(jrsc curl cjson)

add_executable(chat chat.c config.c http.c)
target_link_libraries(chat cjson curl)
target_compile_definitions(chat PRIVATE _GNU_SOURCE)

add_executable(wakechat wakechat.c config.c http.c record.c stt.c token.c ) 
target_link_libraries(wakechat cjson curl snowboy-wrapper snowboy-detect cblas m stdc++ asound)
target_compile_definitions(wakechat PRIVATE _GNU_SOURCE)

add_executable(utils utils.c)
target_link_libraries(utils uuid resolv)

add_executable(tts tts.c config.c http.c play.c)
target_link_libraries(tts cjson curl uuid resolv asound)
target_compile_definitions(tts PRIVATE _GNU_SOURCE)

add_executable(language language.c config.c http.c play.c record.c stt.c token.c)
target_link_libraries(language cjson curl uuid resolv snowboy-wrapper snowboy-detect cblas m stdc++ asound)
target_compile_definitions(language PRIVATE _GNU_SOURCE)